import { RouteRecordRaw, createRouter,createWebHashHistory } from 'vue-router'

const routes:RouteRecordRaw[] = [
    {
        path:'/',
        redirect:'/app/home',
    },
    {
        path:'/screenshot',
        component:()=>import('./../views/screenshot.vue')
    },
    {
        path:'/clipboard',
        component:()=>import('./../views/clipboard.vue')
    },
    {
        path:'/setting',
        component:()=>import('./../views/setting.vue')
    },
    {
        path:'/getcolor',
        component:()=>import('./../views/getcolor.vue')
    },
    {
        path:'/image',
        component:()=>import('./../views/image.vue')
    },
    {
        name:'app',
        path:'/app',
        component:()=>import('./../views/index.vue'),
        children:[
            {
                name:'home',
                path:'home',
                component:()=>import('./../views/home.vue')
            },
            {
                name:'noteEditor',
                path:'noteEditor',
                component:()=>import('./../views/noteEditor.vue')
            },
        ]
    }
]

const router = createRouter({
    routes:routes,
    history:createWebHashHistory()
})

router.beforeEach((guard)=>{
    // console.log(guard)
})

export default router